<template>
    <a-input-search v-model="key" size="large" placeholder="请输入查询关键字" @search="searchClick">
        <a-select slot="addonBefore" v-model="type" :default-value="type" style="width: 90px">
            <a-select-option value="组织">
                组织
            </a-select-option>
            <a-select-option value="人员">
                人员
            </a-select-option>
        </a-select>
        <a-button slot="enterButton" type="primary" enter-button>
            搜索
        </a-button>
    </a-input-search>
</template>

<script>
export default {
    props: ['id'],
    data() {
        return {
            type: '人员',
            key: '',
        }
    },
    mounted() {

    },
    methods: {

        searchClick() {
            if (this.key == '') {
                this.$message.error('请输入查询关键字')
            } else {
                if (this.type == '组织') {
                    var filters = ('{"field":"Organization_Txt","op":"cn","data":"' + this.key + '"}');
                    this.$router.push({
                        path: '/appbuild/8ab3d3e2-edfc-d305-b9c8-a17a5a6253b4',
                        query: {
                            filters: filters,
                            title: this.key
                        }
                    });
                } else {
                    var filters = ('{"field":"Name","op":"cn","data":"' + (this.key) + '"}');
                    this.$router.push({
                        path: '/appbuild/db7f0e88-6aef-846c-15ec-a614ad58145c',
                        query: {
                            filters: filters,
                            title: this.key
                        }
                    });
                }

            }

        },

    }
}
</script>

<style>
.ant-card {
    height: 100%;
}

.anticon-close {
    cursor: pointer;
}

.ant-card-title {
    font-weight: bold;
    font-size: 1.2em;
}

.wait-total-title {
    font-size: 14px;
    margin-top: 20px;
    text-align: center;
    color: red;
}

.wait-total-num {
    text-align: center;
    font-size: 30px;
    font-weight: bold;
}

.item-box span:nth-child(1) {
    font-size: 14px;
    margin-bottom: 5px;
}

.item-box span:nth-child(2) {
    font-size: 24px;
    font-weight: bold;
}

.right-box i {
    background-color: #F2F4F7;
    font-size: 1.5em;
    border-radius: 50%;
    height: 40px;
    width: 40px;
    line-height: 45px;
    text-align: center;
}

.right-box-item .right-box-icon-1 {
    color: #FF394C;
}

.right-box-item .right-box-icon-2 {
    color: #396AFF;
}

.right-box-item .right-box-icon-3 {
    color: #39A0FF;
}
</style>